package ynu.lcy.elememicroserviceserviceclient.service;

import org.springframework.transaction.annotation.Transactional;
import ynu.lcy.dto.delievryAddress.AddDeliveryAddressRequestDTO;
import ynu.lcy.dto.delievryAddress.UpdateDeliveryAddressRequestDTO;
import ynu.lcy.entity.DeliveryAddress;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 配送地址服务
 * @author 梁超映
 * */
@Deprecated
public interface DeliveryAddressService {
    /**
     * 根据用户获取地址
     *
     * @param request 请求
     * @return List<DeliveryAddress>
     */
    public List<DeliveryAddress> list(HttpServletRequest request);

    /**
     * 新建地址
     *
     * @param dto     请求参数
     * @param request 请求
     * @return DeliveryAddress
     */
    public DeliveryAddress save(AddDeliveryAddressRequestDTO dto, HttpServletRequest request);

    /**
     * 更新地址
     *
     * @param dto 请求参数
     * @return boolean
     *
     * */
    @Transactional
    public boolean update(UpdateDeliveryAddressRequestDTO dto);

    /**
     * 根据id获取
     * @param id
     * @return
     * */
    public DeliveryAddress get(Long id);


    /**
     * 删除地址
     *
     * @param id 地址id
     * @return boolean
     * */
    public  boolean delete(Long id);
}
